#include "../inc/findMinMax.h"

void findMinMax(int arr[], int size, int *maxValue, int *minValue, int *maxIndex, int *minIndex) {
    *maxValue = *minValue = arr[0];
    *maxIndex = *minIndex = 0;

    for (int i = 1; i < size; i++) {
        if (arr[i] > *maxValue) {
            *maxValue = arr[i];
            *maxIndex = i;
        }

        if (arr[i] < *minValue) {
            *minValue = arr[i];
            *minIndex = i;
        }
    }
}
